<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        bady{
            padding: 0;
            margin: 0;
            background-color: beige;
        }
        .cube{
            width: 400px;
            height: 400px;
            margin: 100px auto;
            /*perspective: 1000px;*/
            transform:  rotateX(30deg) rotateY(40deg);         /*旋转角度*/
            transform-style: preserve-3d;                  /*使父盒子拥有立体效果*/
            position: relative;
        }
        .front, .back, .left, .right, .top, .bottom {
            width: 100%;
            height: 100%;
            text-align: center;
            line-height: 400px;
            font-size: 40px;
            opacity: 0.8; /*透明度*/
            position: absolute; /* 给盒子加定位*/
            top: 17px;;
            left:0;
        }
        .front{
            background-color: #ff0e09;
            transform: translateZ(200px);
        }
        .back{
            background-color:orchid;
            transform: translateZ(-200px);
        }
        .left{
            background-color: aqua;
            transform: rotateY(90deg) translateZ(-200px);
        }
        .right{
            background-color: #fffc20;
            transform: rotateY(90deg) translateZ(200px);
        }
        .top{
            background-color: #1cffd0;
            transform: rotateX(90deg) translateZ(200px);
        }
        .bottom{
            background-color: #e128c6;
            transform: rotateX(90deg) translateZ(-200px);
        }
    </style>
</head>
<body>
    <div class="cube">
        <div class="front">front</div>
        <div class="back">back</div>
        <div class="left">left</div>
        <div class="right">right</div>
        <div class="top">top</div>
        <div class="bottom">bottom</div>
    </div>
</body>
</html>